/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.diamondsys.embrapa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "rh_tb_lotacao")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RhTbLotacao.findAll", query = "SELECT r FROM RhTbLotacao r ORDER BY r.descricao ASC"),
    @NamedQuery(name = "RhTbLotacao.findByCodLotacao", query = "SELECT r FROM RhTbLotacao r WHERE r.codLotacao = :codLotacao"),
    @NamedQuery(name = "RhTbLotacao.findByDescricao", query = "SELECT r FROM RhTbLotacao r WHERE r.descricao = :descricao")})
public class RhTbLotacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cod_lotacao")
    private Integer codLotacao;
    @Size(max = 60)
    @Column(name = "descricao")
    private String descricao;

    public RhTbLotacao() {
    }

    public RhTbLotacao(Integer codLotacao) {
        this.codLotacao = codLotacao;
    }

    public Integer getCodLotacao() {
        return codLotacao;
    }

    public void setCodLotacao(Integer codLotacao) {
        this.codLotacao = codLotacao;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codLotacao != null ? codLotacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RhTbLotacao)) {
            return false;
        }
        RhTbLotacao other = (RhTbLotacao) object;
        if ((this.codLotacao == null && other.codLotacao != null) || (this.codLotacao != null && !this.codLotacao.equals(other.codLotacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.diamondsys.embrapa.RhTbLotacao[ codLotacao=" + codLotacao + " ]";
    }
    
}
